package com.changgou.business.dao;

import com.changgou.business.pojo.Ad;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.Mapper;

public interface AdMapper extends Mapper<Ad> {





    //将当前位置置顶状态修改为非置顶
    @Update("UPDATE tb_ad SET istop=0 WHERE  POSITION=#{position} AND istop=1")
    public void updateTopToZero(int position);

    //将置顶id广告设置为置顶状态
    @Update("UPDATE tb_ad SET istop=1 WHERE  id=#{id}")
    public void updateToTop(int id);
}
